Knowledge Data Models
Knowledge-oriented DataModel primitives.
labelled entities, typed relations, knowledge graphs, used by the knowledge base layer.
The is_* predicates work for any data-model flavour
(SymbolicDataModel, JsonDataModel, DataModel, Variable) by
inspecting the JSON schema.
EmbeddedEntity
An entity with an embedding vector
Source code in synalinks/src/backend/pydantic/knowledge.py
Entities
Entity
KnowledgeGraph
Bases: DataModel
A knowledge graph (entities + relations)
Source code in synalinks/src/backend/pydantic/knowledge.py
KnowledgeGraphs
Bases: DataModel
A list of knowledge graphs
Source code in synalinks/src/backend/pydantic/knowledge.py
Relation
Relations
is_embedded_entity(x)
Checks if the given data model is an embedded entity
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/knowledge.py
is_entities(x)
Checks if is an entities model
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/knowledge.py
is_entity(x)
Checks if the given data model is an entity
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/knowledge.py
is_knowledge_graph(x)
Checks if is a knowledge graph model
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/knowledge.py
is_knowledge_graphs(x)
Checks if is a knowledge graphs model
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/knowledge.py
is_relation(x)
Checks if is a relation model
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/knowledge.py
is_relations(x)
Checks if is an relations model
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the condition is met |